import React from 'react';
import { Progress, Card } from 'antd';


class MyChart extends React.Component {
  constructor(...args) {
    super(...args);
  }
  render() {
    const { title, msg } = this.props || ' ';
    const arr = msg || [];
    let i = 0;
    const myarr = arr.map((item) => {
      return (
        <div key={i++}>
          <p style={{ fontWeight: 'bold' }}>{item.province} <span style={{ float: 'right', marginRight: '32px' }}>人数：{item.count}</span></p>
          <Progress percent={item.data} status="active" />
        </div>
      );
    });

    return (
      <Card bodyStyle={{ padding: '15px' }}>
        <h3 style={{ textAlign: 'center' }}>{title}</h3>
        {myarr}
      </Card>
    );
  }
}


MyChart.propTypes = {
};

export default MyChart;
